<template>
    <Crud :table="table" :columns="columns" v-model:saveFormData="saveFormData" v-model:searchObj="searchObj"
          editTexT="审核" :showAdd="false">
        <template #save>
            <a-form
                ref="save_form"
                :model="saveFormData"
                :label-col="{ span: 6 }"
                :wrapper-col="{ span: 18 }"
            >
              <a-form-item label="状态" name="status" :rules="[{ required: true, message: '' }]">
                  <Select :disabled="saveFormData.status!==1" v-model:value="saveFormData.status" :constant="constant.tixian_status"/>
              </a-form-item>
              <a-form-item label="备注" name="remark">
                <a-input v-model:value="saveFormData.remark"/>
              </a-form-item>

            </a-form>
        </template>
        <template #search>
            <a-form
                layout="inline"
            >
              <a-form-item label="状态" name="status">
                  <Select v-model:value="searchObj.status" :constant="constant.tixian_status"/>
              </a-form-item>
              <a-form-item>
                <RemoteSelect placeholder="用户" table="user" name_key="nickname" v-model:value="searchObj.user_id"/>
              </a-form-item>
              <a-form-item>
                <a-input placeholder="收款姓名" v-model:value="searchObj.name"/>
              </a-form-item>
              <a-form-item>
                <a-input placeholder="收款账号" v-model:value="searchObj.account"/>
              </a-form-item>

            </a-form>
        </template>
    </Crud>
</template>

<script>

export default {
    name: "list",
    data: function () {
        return {
            table: 'tixian',
            saveFormData: {},
            searchObj: {
              status:1,
            },
            columns: [
                {
                    title: '用户ID',
                    key: 'user_id',
                }, {
                    title: '金额',
                    key: 'money',
                }, {
                    title: '状态',
                    key: 'status',
                    render: (record) => {
                        return this.constant.tixian_status[record.status]
                    }
                }, {
                    title: '账户',
                    key: 'account',
                }, {
                    title: '描述',
                    key: 'title',
                }, {
                    title: '备注',
                    key: 'remark',
                }, {
                    title: '时间',
                    key: 'add_time',
                },{
                    title: '渠道',
                    key: 'type',
                },
            ],
        };
    },
    computed: {
        table_key() {
            return `${this.table}_id`
        },
    },
    components: {},
    created() {
    },
    methods: {}
}
</script>

<style scoped lang="less">

</style>